﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage/MasterPage.master" AutoEventWireup="true"
    CodeFile="WorkOnType.aspx.cs" Inherits="WorkTimeN_WorkOnType" %>

<asp:Content ID="Content1" ContentPlaceHolderID="Titile" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="head" runat="Server">
    <link href="../StyleSheet.css" rel="stylesheet" type="text/css" />

    <script>
        function uopen(u) {
            window.open(u, '员工搜索', 'height=700, width=600, toolbar=no, menubar=no, scrollbars=yes,status=no,top=200,left=300');
            return false;
        }
    </script>

</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="Content" runat="Server">
    <div>
        <infolight:webdatasource id="Master" runat="server" autoapply="True" webdatasetid="WMaster"
            datamember="WorkOnTypeMaster">
        </infolight:webdatasource>
    </div>
    <infolight:webdatasource id="Detail" runat="server" masterdatasource="Master" webdatasetid="WMaster"
        datamember="WorkOnTypeDetail" autoapply="False" autoapplyforinsert="False">
    </infolight:webdatasource>
    <infolight:webnavigator id="WebNavigator1" runat="server" bindingobject="wfvMaster"
        oncommand="WebNavigator1_Command" showdatastyle="FormViewStyle" width="100%"
        statusstrip="WebStatusStrip1" cssclass="NavigatorBar" ctlheight="25" height="25px">
        <navcontrols>
                <InfoLight:ControlItem ControlName="First" ControlText="掸" ControlType="Image" ControlVisible="True"
                    ImageUrl="../image/uipics/first_C.gif" MouseOverImageUrl="../image/uipics/first2_C.gif"
                    Size="48" DisenableImageUrl="../image/uipics/first3_C.gif" />
                <InfoLight:ControlItem ControlName="Previous" ControlText="掸" ControlType="Image"
                    ControlVisible="True" ImageUrl="../image/uipics/previous_C.gif" MouseOverImageUrl="../image/uipics/previous2_C.gif"
                    Size="48" DisenableImageUrl="../image/uipics/previous3_C.gif" />
                <InfoLight:ControlItem ControlName="Next" ControlText="掸" ControlType="Image" ControlVisible="True"
                    ImageUrl="../image/uipics/next_C.gif" MouseOverImageUrl="../image/uipics/next2_C.gif"
                    Size="48" DisenableImageUrl="../image/uipics/next3_C.gif" />
                <InfoLight:ControlItem ControlName="Last" ControlText="ソ掸" ControlType="Image" ControlVisible="True"
                    ImageUrl="../image/uipics/last_C.gif" MouseOverImageUrl="../image/uipics/last2_C.gif"
                    Size="48" DisenableImageUrl="../image/uipics/next3_C.gif" />
                <InfoLight:ControlItem ControlName="Add" ControlText="穝糤" ControlType="Image" ControlVisible="True"
                    ImageUrl="../image/uipics/add_C.gif" MouseOverImageUrl="../image/uipics/add2_C.gif"
                    Size="48" DisenableImageUrl="../image/uipics/add3_C.gif" />
                <InfoLight:ControlItem ControlName="Update" ControlText="э" ControlType="Image"
                    ControlVisible="True" ImageUrl="../image/uipics/edit_C.gif" MouseOverImageUrl="../image/uipics/edit2_C.gif"
                    Size="48" DisenableImageUrl="../image/uipics/edit3_C.gif" />
                <InfoLight:ControlItem ControlName="Delete" ControlText="埃" ControlType="Image"
                    ControlVisible="True" ImageUrl="../image/uipics/delete_C.gif" MouseOverImageUrl="../image/uipics/delete2_C.gif"
                    Size="48" DisenableImageUrl="../image/uipics/delete3_C.gif" />
                <InfoLight:ControlItem ControlName="OK" ControlText="絋粄" ControlType="Image" ControlVisible="False"
                    ImageUrl="../image/uipics/ok_C.gif" MouseOverImageUrl="../image/uipics/ok2_C.gif"
                    Size="48" DisenableImageUrl="../image/uipics/ok3_C.gif" />
                <InfoLight:ControlItem ControlName="Cancel" ControlText="" ControlType="Image"
                    ControlVisible="True" ImageUrl="../image/uipics/cancel_C.gif" MouseOverImageUrl="../image/uipics/cancel2_C.gif"
                    Size="48" DisenableImageUrl="../image/uipics/cancel3_C.gif" />
                <InfoLight:ControlItem ControlName="Apply" ControlText="郎" ControlType="Image" ControlVisible="True"
                    ImageUrl="../image/uipics/apply_C.gif" MouseOverImageUrl="../image/uipics/apply2_C.gif"
                    Size="48" DisenableImageUrl="../image/uipics/apply3_C.gif" />
                <InfoLight:ControlItem ControlName="Abort" ControlText="斌" ControlType="Image" ControlVisible="True"
                    ImageUrl="../image/uipics/abort_C.gif" MouseOverImageUrl="../image/uipics/abort2_C.gif"
                    Size="48" DisenableImageUrl="../image/uipics/abort3_C.gif" />
                <InfoLight:ControlItem ControlName="Query" ControlText="琩高" ControlType="Image" ControlVisible="False"
                    ImageUrl="../image/uipics/query_C.gif" MouseOverImageUrl="../image/uipics/query2_C.gif"
                    Size="48" DisenableImageUrl="../image/uipics/query3_C.gif" />
                <InfoLight:ControlItem ControlName="Print" ControlText="ゴ" ControlType="Image" ControlVisible="False"
                    ImageUrl="../image/uipics/print_C.gif" MouseOverImageUrl="../image/uipics/print2_C.gif"
                    Size="48" DisenableImageUrl="../image/uipics/print3_C.gif" />
                <InfoLight:ControlItem ControlName="Export" ControlType="Image" ControlVisible="False"
                    DisenableImageUrl="../Image/UIPics/Export3_C.gif" ImageUrl="../Image/UIPics/Export_C.gif"
                    MouseOverImageUrl="../Image/UIPics/Export2_C.gif" Size="48" />
            </navcontrols>
        <navstates>
                <InfoLight:WebNavigatorStateItem StateText="Initial" />
                <InfoLight:WebNavigatorStateItem StateText="Browsed" />
                <InfoLight:WebNavigatorStateItem StateText="Inserting" />
                <InfoLight:WebNavigatorStateItem StateText="Editing" />
                <InfoLight:WebNavigatorStateItem StateText="Applying" />
                <InfoLight:WebNavigatorStateItem StateText="Changing" />
                <InfoLight:WebNavigatorStateItem StateText="Querying" />
                <InfoLight:WebNavigatorStateItem StateText="Printing" />
            </navstates>
    </infolight:webnavigator>
    <infolight:webformview id="wfvMaster" runat="server" onpageindexchanged="wfvMaster_PageIndexChanged"
        allowpaging="True" allvalidatesucess="True" cellpadding="4" datahaschanged="False"
        datasourceid="Master" insertback="False" layoutcolnum="2" onafterinsertlocate="wfvMaster_AfterInsertLocate"
        oncanceled="wfvMaster_Canceled" autoemptydatatext="False" height="87px" keyvalues=""
        needexecuteadd="True" oldpageindex="-1" validatefailed="False" 
        width="100%" borderwidth="2px">
        <edititemtemplate>
       <table class="tbE" cellpadding="5">
         <tr>
             <td class="label1">
                  <asp:Label ID="Label9" runat="server" AssociatedControlID="" Text="编号">
                            </asp:Label>
             </td>
         <td class="textbox">
 <asp:TextBox ID="TextBox5" runat="server" AutoCompleteType="None" 
                                AutoPostBack="False" CausesValidation="False" Columns="0" MaxLength="2" 
                                ReadOnly="False" Rows="0" Text='<%# Bind("TMid") %>' TextMode="SingleLine" 
                                ValidationGroup="" Wrap="True"></asp:TextBox>             </td>
             <td class="label2">
                <asp:Label ID="Label10" runat="server" AssociatedControlID="" 
                                Text="名称"> </asp:Label>
             </td>
             <td class="textbox">
             <asp:TextBox ID="TextBox6" runat="server" AutoCompleteType="None" 
                                AutoPostBack="False" CausesValidation="False" Columns="0" MaxLength="0" 
                                ReadOnly="False" Rows="0" Text='<%# Bind("GroupName") %>' TextMode="SingleLine" 
                                ValidationGroup="" Wrap="True">
                            </asp:TextBox>
             </td>
         </tr>
         <tr>
                      <td class="label1">
                            <asp:Label ID="Label11" runat="server" AssociatedControlID="" Text="描述">
                            </asp:Label>
                        </td>
                         <td class="textbox">
                            <asp:TextBox ID="TextBox7" runat="server" AutoCompleteType="None" 
                                AutoPostBack="False" CausesValidation="False" Columns="0" MaxLength="0" 
                                ReadOnly="False" Rows="0" Text='<%# Bind("GroupDes") %>' TextMode="SingleLine" 
                                ValidationGroup="" Wrap="True">
                            </asp:TextBox>
                        </td>
                           <td class="label1">
                            <asp:Label ID="Label12" runat="server" AssociatedControlID="" Text="类别">
                            </asp:Label>
                        </td>
                       <td class="textbox">
                            <asp:TextBox ID="TextBox8" runat="server" AutoCompleteType="None" 
                                AutoPostBack="False" CausesValidation="False" Columns="0" MaxLength="1" 
                                ReadOnly="False" Rows="0" Text='<%# Bind("GType") %>' TextMode="SingleLine" 
                                ValidationGroup="" Wrap="True"></asp:TextBox>
                        </td>
                    </tr>
         </table>
            </edititemtemplate>
        <insertitemtemplate>
         <table class="tbI" cellpadding="5">
         <tr>
             <td class="label1">
                  <asp:Label ID="Label1" runat="server" AssociatedControlID="" Text="编号">
                            </asp:Label>
             </td>
             <td class="textbox">
 <asp:TextBox ID="TMidTextBoxI" runat="server" AutoCompleteType="None" 
                                AutoPostBack="False" CausesValidation="False" Columns="0" MaxLength="2" 
                                ReadOnly="False" Rows="0" Text='<%# Bind("TMid") %>' TextMode="SingleLine" 
                                ValidationGroup="" Wrap="True"></asp:TextBox>             </td>
             <td class="label2">
                <asp:Label ID="Label2" runat="server" AssociatedControlID="" 
                                Text="名称"> </asp:Label>
             </td>
             <td class="textbox">
             <asp:TextBox ID="GroupNameTextBoxI" runat="server" AutoCompleteType="None" 
                                AutoPostBack="False" CausesValidation="False" Columns="0" MaxLength="0" 
                                ReadOnly="False" Rows="0" Text='<%# Bind("GroupName") %>' TextMode="SingleLine" 
                                ValidationGroup="" Wrap="True">
                            </asp:TextBox>
             </td>
         </tr>
         <tr>
                      <td class="label1">
                            <asp:Label ID="Label3" runat="server" AssociatedControlID="" Text="描述">
                            </asp:Label>
                        </td>
                         <td class="textbox">
                            <asp:TextBox ID="GroupDesTextBoxI" runat="server" AutoCompleteType="None" 
                                AutoPostBack="False" CausesValidation="False" Columns="0" MaxLength="0" 
                                ReadOnly="False" Rows="0" Text='<%# Bind("GroupDes") %>' TextMode="SingleLine" 
                                ValidationGroup="" Wrap="True">
                            </asp:TextBox>
                        </td>
                           <td class="label1">
                            <asp:Label ID="Label4" runat="server" AssociatedControlID="" Text="类别">
                            </asp:Label>
                        </td>
                       <td class="textbox">
                            <asp:TextBox ID="GTypeTextBoxI" runat="server" AutoCompleteType="None" 
                                AutoPostBack="False" CausesValidation="False" Columns="0" MaxLength="1" 
                                ReadOnly="False" Rows="0" Text='<%# Bind("GType") %>' TextMode="SingleLine" 
                                ValidationGroup="" Wrap="True"></asp:TextBox>
                        </td>
                    </tr>
         </table>
            </insertitemtemplate>
        <itemtemplate>
                       <table class="tbR" cellpadding="5">
                     <tr>
                         <td class="label1">
                              <asp:Label ID="Label5" runat="server" AssociatedControlID="" Text="编号">
                                        </asp:Label>
                         </td>
                <td class="textbox">
             <asp:TextBox ID="TextBox1" runat="server" AutoCompleteType="None" 
                                            AutoPostBack="False" CausesValidation="False" Columns="0" MaxLength="0" 
                                            ReadOnly="False" Rows="0" Text='<%# Bind("TMid") %>' TextMode="SingleLine" 
                                            ValidationGroup="" Wrap="True">
                                        </asp:TextBox>             </td>
                         <td class="label2">
                            <asp:Label ID="Label6" runat="server" AssociatedControlID="" 
                                            Text="名称"> </asp:Label>
                         </td>
                         <td class="textbox">
                         <asp:TextBox ID="TextBox2" runat="server" AutoCompleteType="None" 
                                            AutoPostBack="False" CausesValidation="False" Columns="0" MaxLength="0" 
                                            ReadOnly="False" Rows="0" Text='<%# Bind("GroupName") %>' TextMode="SingleLine" 
                                            ValidationGroup="" Wrap="True">
                                        </asp:TextBox>
                         </td>
                     </tr>
                     <tr>
                      <td class="label1">
                            <asp:Label ID="Label7" runat="server" AssociatedControlID="" Text="描述">
                            </asp:Label>
                        </td>
                         <td class="textbox">
                            <asp:TextBox ID="TextBox3" runat="server" AutoCompleteType="None" 
                                AutoPostBack="False" CausesValidation="False" Columns="0" MaxLength="0" 
                                ReadOnly="False" Rows="0" Text='<%# Bind("GroupDes") %>' TextMode="SingleLine" 
                                ValidationGroup="" Wrap="True">
                            </asp:TextBox>
                        </td>
                           <td class="label1">
                            <asp:Label ID="Label8" runat="server" AssociatedControlID="" Text="类别">
                            </asp:Label>
                        </td>
                       <td class="textbox">
                            <asp:TextBox ID="TextBox4" runat="server" AutoCompleteType="None" 
                                AutoPostBack="False" CausesValidation="False" Columns="0" MaxLength="0" 
                                ReadOnly="False" Rows="0" Text='<%# Bind("GType") %>' TextMode="SingleLine" 
                                ValidationGroup="" Wrap="True">
                            </asp:TextBox>
                        </td>
                    </tr>
                  
         </table>
            </itemtemplate>
        <fields>
                <InfoLight:FormViewField ControlID="TMidTextBoxI" FieldName="TMid" />
                <InfoLight:FormViewField ControlID="GroupNameTextBoxI" FieldName="GroupName" />
                <InfoLight:FormViewField ControlID="GroupDesTextBoxI" FieldName="GroupDes" />
                <InfoLight:FormViewField ControlID="GTypeTextBoxI" FieldName="GType" />
            </fields>
        <footerstyle backcolor="#507CD1" forecolor="White" font-bold="True" />
        <editrowstyle backcolor="LightCyan" forecolor="Blue" />
        <pagerstyle forecolor="White" horizontalalign="Center" backcolor="PowderBlue" />
        <headerstyle backcolor="#507CD1" font-bold="True" forecolor="White" />
        <insertrowstyle backcolor="LightCyan" forecolor="Blue" />
    </infolight:webformview>
    <br />
    <div>
        <span style="color: Red">备注 : 主表类别 N 代表 常日班（可多项），S 代表 三班（只可唯一），上班最早或下班最晚时间离实际上班或下班时间的小时差值必须为1</span>
    </div>
    <br />
    <infolight:webgridview id="wgvMaster" runat="server" datasourceid="Detail" width="100%"
        aborticonurl="../Image/UIPics/Abort.gif" addiconurl="../Image/UIPics/Add.gif"
        applyiconurl="../Image/UIPics/Apply.gif" canceliconurl="../Image/UIPics/Cancel.gif"
        mouseoveraborticonurl="../Image/UIPics/Abort2.gif" mouseoveraddiconurl="../Image/UIPics/Add2.gif"
        mouseoverapplyiconurl="../Image/UIPics/Apply2.gif" mouseovercanceliconurl="../Image/UIPics/Cancel2.gif"
        mouseoverokiconurl="../Image/UIPics/OK2.gif" mouseoverqueryiconurl="../Image/UIPics/Query2.gif"
        okiconurl="../Image/UIPics/OK.gif" queryiconurl="../Image/UIPics/Query.gif" headerstylewrap="False"
        pagesize="15" cellpadding="5" cssclass="xpTable">
        <rowstyle horizontalalign="Center"></rowstyle>
        <pagersettings mode="NumericFirstLast" />
        <footerstyle backcolor="#507CD1" forecolor="White" font-bold="True"></footerstyle>
        <rowstyle backcolor="#EFF3FB"></rowstyle>
        <editrowstyle backcolor="#2461BF"></editrowstyle>
        <navcontrols>
                 <InfoLight:ControlItem ControlName="Add" ControlText="add" ControlType="Image" 
                     ControlVisible="True" DisenableImageUrl="../image/uipics/add3.gif" 
                     ImageUrl="../image/uipics/add.gif" MouseOverImageUrl="../image/uipics/add2.gif" 
                     Size="25" />
                 <InfoLight:ControlItem ControlName="Query" ControlText="query" 
                     ControlType="Image" ControlVisible="False" 
                     DisenableImageUrl="../image/uipics/query3.gif" 
                     ImageUrl="../image/uipics/query.gif" 
                     MouseOverImageUrl="../image/uipics/query2.gif" Size="25" />
                 <InfoLight:ControlItem ControlName="Apply" ControlText="apply" 
                     ControlType="Image" ControlVisible="True" 
                     DisenableImageUrl="../image/uipics/apply3.gif" 
                     ImageUrl="../image/uipics/apply.gif" 
                     MouseOverImageUrl="../image/uipics/apply2.gif" Size="25" />
                 <InfoLight:ControlItem ControlName="Abort" ControlText="abort" 
                     ControlType="Image" ControlVisible="False" 
                     DisenableImageUrl="../image/uipics/abort3.gif" 
                     ImageUrl="../image/uipics/abort.gif" 
                     MouseOverImageUrl="../image/uipics/abort2.gif" Size="25" />
                 <InfoLight:ControlItem ControlName="OK" ControlText="Insert" 
                     ControlType="Image" ControlVisible="True" 
                     DisenableImageUrl="../image/uipics/ok3.gif" ImageUrl="../image/uipics/ok.gif" 
                     MouseOverImageUrl="../image/uipics/ok2.gif" Size="25" />
                 <InfoLight:ControlItem ControlName="Cancel" ControlText="cancel" 
                     ControlType="Image" ControlVisible="True" 
                     DisenableImageUrl="../image/uipics/cancel3.gif" 
                     ImageUrl="../image/uipics/cancel.gif" 
                     MouseOverImageUrl="../image/uipics/cancel2.gif" Size="25" />
             </navcontrols>
        <selectedrowstyle backcolor="#D1DDF1" forecolor="#333333" font-bold="True"></selectedrowstyle>
        <pagerstyle backcolor="LightBlue" forecolor="White" horizontalalign="Center"></pagerstyle>
        <headerstyle backcolor="DeepSkyBlue" forecolor="White" font-bold="True"></headerstyle>
        <alternatingrowstyle backcolor="White" bordercolor="White"></alternatingrowstyle>
        <columns>
                <asp:TemplateField ShowHeader="False">
                    <edititemtemplate>
<asp:ImageButton runat="server" Text="Update" CommandName="Update" ImageUrl="~/Image/UIPics/OK.gif" CausesValidation="True" id="ImageButton6"></asp:ImageButton>&nbsp;<asp:ImageButton runat="server" Text="Cancel" CommandName="Cancel" ImageUrl="~/Image/UIPics/Cancel.gif" CausesValidation="False" id="ImageButton7"></asp:ImageButton>
</edititemtemplate>
                    <headerstyle wrap="False" />
                    <itemtemplate>
<asp:ImageButton runat="server" Text="Edit" CommandName="Edit" ImageUrl="~/Image/UIPics/Edit.gif" CausesValidation="False" id="ImageButton8"></asp:ImageButton>&nbsp;<asp:ImageButton runat="server" Text="Delete" CommandName="Delete" ImageUrl="~/Image/UIPics/Delete.gif" CausesValidation="False" id="ImageButton9"></asp:ImageButton>
</itemtemplate>
                </asp:TemplateField>
                <asp:BoundField DataField="TDid" HeaderText="编号" SortExpression="TDid" 
                    ReadOnly="True" />
                <asp:BoundField DataField="TMid" HeaderText="组编号" SortExpression="TMid" 
                    ReadOnly="True" />
                <asp:BoundField DataField="StartTimeOfWorkOnTime" HeaderText="上班考勤最早时间" 
                    SortExpression="StartTimeOfWorkOnTime" />
                <asp:BoundField DataField="EndTimeOfWorkOnTime" HeaderText="下班考勤最早时间" 
                    SortExpression="EndTimeOfWorkOnTime" />
                <asp:BoundField DataField="LateOfStartTime" HeaderText="上班考勤最晚时间" 
                    SortExpression="LateOfStartTime" />
                <asp:BoundField DataField="LeaveOfEndTime" HeaderText="下班考勤最晚时间" 
                    SortExpression="LeaveOfEndTime" />
            </columns>
        <pagersettings mode="NumericFirstLast" />
    </infolight:webgridview>
    <infolight:webdefault id="wdWorkOnTypeMaster" runat="server" defaultactive="True"
        datasourceid="Master" datamember="WorkOnTypeMaster" carryonactive="False">
        <fields>
		<Infolight:DefaultFieldItem DefaultValue="N" FieldName="GType" CarryOn="False" />
	</fields>
    </infolight:webdefault>
    <infolight:webvalidate id="wvWorkOnTypeMaster" runat="server" datasourceid="Master"
        datamember="WorkOnTypeMaster"
        rowcss="" altrowcss="" ForeColor="Red" ValidateStyle="ShowDialog">
        <fields>
		<Infolight:ValidateFieldItem FieldName="TMid" CheckNull="True" 
                ValidateLabelLink="主表编号" Validate="ValTMid()" 
                WarningMsg="主表编号不为NB或AB 且不为空" />
		<Infolight:ValidateFieldItem FieldName="GroupName" CheckNull="True" ValidateLabelLink="CaptionGroupName" />
		<Infolight:ValidateFieldItem FieldName="GType" CheckNull="True" ValidateLabelLink="CaptionGType" />
	</fields>
    </infolight:webvalidate>
    <infolight:webdefault id="wdWorkOnTypeDetail" runat="server" defaultactive="True"
        datasourceid="Detail" datamember="WorkOnTypeDetail" carryonactive="False">
        <fields>
		<Infolight:DefaultFieldItem DefaultValue="0" FieldName="TDid" CarryOn="False" />
	</fields>
    </infolight:webdefault>
    <infolight:webautoseq id="WebAutoSeq1" runat="server" datasourceid="Detail" fieldname="TDid" />
    <infolight:webvalidate id="wvWorkOnTypeDetail" runat="server" datasourceid="Detail"
        datamember="WorkOnTypeDetail" validateactive="True" validatechar="" duplicatecheck="False"
        duplicatecheckmode="ByLocal" validatestyle="ShowLable" multilanguage="False"
        rowcss="" altrowcss="">
        <fields>
		<Infolight:ValidateFieldItem FieldName="TDid" CheckNull="True" ValidateLabelLink="CaptionTDid" />
		<Infolight:ValidateFieldItem FieldName="TMid" CheckNull="True" ValidateLabelLink="CaptionTMid" />
		<Infolight:ValidateFieldItem FieldName="StartTimeOfWorkOnTime" CheckNull="True" ValidateLabelLink="CaptionStartTimeOfWorkOnTime" />
		<Infolight:ValidateFieldItem FieldName="EndTimeOfWorkOnTime" CheckNull="True" ValidateLabelLink="CaptionEndTimeOfWorkOnTime" />
		<Infolight:ValidateFieldItem FieldName="LateOfStartTime" CheckNull="True" ValidateLabelLink="CaptionLateOfStartTime" />
		<Infolight:ValidateFieldItem FieldName="LeaveOfEndTime" CheckNull="True" ValidateLabelLink="CaptionLeaveOfEndTime" />
	</fields>
    </infolight:webvalidate>
</asp:Content>
